# -*- coding:utf-8 -*-

import sys
from PyQt5 import uic
from PyQt5.QtWidgets import *

class calculator(QWidget):
    def __init__(self):
        super().__init__()
        self.init_ui()
    def init_ui(self):
        self.ui = uic.loadUi("./calculator.ui")
        self.displayUiInit()
        self.keyboardUiInit()
        # self.operatorUiInit()

    def displayUiInit(self):
        self.display = self.ui.display

    def keyboardUiInit(self):
        self.num_dot = self.ui.num_dot
        self.num_0 = self.ui.num_0
        self.num_00 = self.ui.num_00
        self.num_1 = self.ui.num_1
        self.num_2 = self.ui.num_2
        self.num_3 = self.ui.num_3
        self.num_4 = self.ui.num_4
        self.num_5 = self.ui.num_5
        self.num_6 = self.ui.num_6
        self.num_7 = self.ui.num_7
        self.num_8 = self.ui.num_8
        self.num_9 = self.ui.num_9

    def operatorUiInit(self):
        self.num_add = self.ui.num_add
        self.num_sub = self.ui.num_sub
        self.num_mul = self.ui.num_mul
        self.num_div = self.ui.num_div

if __name__ == "__main__":

    app = QApplication(sys.argv)
    a = calculator()
    a.ui.setWindowTitle("计算器")
    a.ui.show()
    app.exec()
